CON

  _clkmode = xtal1 + pll16x
  _xinfreq = 5_000_000

  RX_PIN        = 0
  EN_PIN        = 1

var

byte    buff[12]




obj

  rfid  :       "FullDuplexSerial"
  d     :       "Parallax Serial Terminal"       

pub go | i, data

  'rfid.init(RX_PIN, -1, 2400)
  rfid.start(RX_PIN, -1, 0, 2400)
  d.start(115_200)

  dira[EN_PIN]~~

  repeat

    outa[EN_PIN]~               'device enable pin is active low

    rfid.rxflush    
    rfid.rx                     'throw away the first start byte from the RFID reader                        
    repeat i from 0 to 10
      buff[i] := rfid.rx

    outa[RX_PIN]~~              'make device inactive
      
    buff[10] := 0               'zero terminate

    d.str(@buff)                'print the buffer

    d.char(13)                  'print a new line

    waitcnt(cnt + clkfreq)     'slight pause

  